home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Tricks of the Mac Game Programming Gurus
/
TricksOfTheMacGameProgrammingGurus.iso
/
Book Chapters
/
10 - Networking
/
NovelNetwar
/
globals.c
< prev
next >
Wrap
Text File
|
1995-05-12
|
913b
|
71 lines
// Global variables!
#include "NovelNetwar.h"
#include <GestaltEqu.h>
#include <Traps.h>
#include <Palettes.h>
char alive,IAmFrontApp,hasColourQD,hasAppleTalk;
Rect nullRect;
char errorMessage[256];
int connectionMethod;
void globalsInit(void)
{
SysEnvRec theWorld;
long gestaltResponse;
alive = TRUE;
IAmFrontApp = TRUE;
hasColourQD = FALSE;
hasAppleTalk = FALSE;
SetRect(&nullRect,-32768,-32768,32767,32767);
connectionMethod = NONE;
if (SysEnvirons(1,&theWorld) == noErr)
{
if (theWorld.hasColorQD)
{
if (HasDepth(GetMainDevice(),8,gdDevType,gdDevType) != 0)
{
hasColourQD = TRUE;
}
}
}
if (TrapAvailable((int) _Gestalt) == noErr)
{
if (Gestalt(gestaltAppleTalkVersion,&gestaltResponse) == noErr)
{
if (gestaltResponse != 0)
{
hasAppleTalk = TRUE;
}
}
}
}
void globalsStartup(void)
{
}
void globalsShutDown(void)
{
}